<script>

export default {
  name: 'MainCard',
  data () {
    return {}
  },
  props: [
    'shu'
  ],
  methods: {
    todetail () {
      this.$router.push({
        name: 'detail',
        params: {
          bowenid: this.shu.id
        }
      })
    }
  },
  computed: {}
}
</script>

<template>
  <el-card class="box-card" :body-style="{ padding: '0px' }" @click.native="todetail">
    <div class="card1">
      <div class="c1">
        <img :src="shu.imgurl" alt="">
      </div>
      <div class="text">
        <div class="title"> {{ shu.title }}</div>
        <div class="jianjie">
          上传日期&nbsp;&nbsp;{{shu.postdate.split('T')[0]}}&nbsp;&nbsp;|&nbsp;&nbsp;字数&nbsp;&nbsp;{{shu.zishu}}
          <br>
          &nbsp;&nbsp;&nbsp;&nbsp;类别&nbsp;&nbsp;{{shu.fenlei_display}}
        </div>
      </div>
    </div>
  </el-card>
</template>

<style scoped lang="scss">
$bgd: rgba(0, 0, 0, 0.5);
$hoverbgd: rgba(0, 0, 0, 0.7);
$textcol: white;
.box-card {
  box-sizing: border-box;
  border: 2px solid #003153;
  padding: 5px;
  height: 250px;
  transition: all .5s;
  max-width: 1380px;
  border-radius: 30px;
  margin-bottom: 15px;
  background-color: $bgd;
  overflow: hidden;
  @media (max-width: 700px) {
    height: 150px;
  }

  .card1 {
    display: flex;
    align-items: center;
    //justify-content: space-between;

    .c1 {
      border-radius: 30px;
      overflow: hidden;
      height: 236px;
      width: 375px;
      @media (max-width: 1400px) {
        &.c1 {
          width: 26vw;
        }
      };
      @media (max-width: 992px) {
        &.c1 {
          width: 45vw;
        }
      };
      @media (max-width: 700px) {
        height: 136px;
      }
    }

    img {
      width: 375px;
      transition: all .5s;
      height: 236px;
      @media (max-width: 1400px) {
        & {
          width: 26vw;
        }
      }
      @media (max-width: 992px) {
        & {
          width: 45vw;
        }
      };
      @media (max-width: 700px) {
        height: 136px;
      }
    }

    img:hover {
      transform: scale(1.05);
    }
  }

  &:hover {
    box-shadow: 5px 5px 5px #003153;
    background: $hoverbgd;
    transform: scale(0.95);
    cursor: pointer;
    border: 2px solid $hoverbgd;
  }
}

.text {
  transition: all .5s;
  display: flex;
  //justify-content: center;
  align-items: center;
  flex-direction: column;
  font-weight: normal;
  color: $textcol;
  margin-left: 50px;
  //max-width: 150px;
  @media (max-width: 600px) {
      margin-left: 25px;
  }
  .title{
    font-size: 20px;
    font-weight: bold;
    line-height: 40px;
  }
  .jianjie{
    font-size: 12px;
    color: grey;
  }
}

</style>
